

#include "Thread.h"
#include "imgA4.hpp"
#include "aligntarget.hpp"
extern "C" {
#include "SEEKFREE_MT9V03X_CSI.h"
#include "common.h"
#include "zf_gpio.h"
#include "zf_usb_cdc.h"
}

#include "visualization.hpp"
float th=10;

static void imgUSBXferEntry(void*)
	{
	using namespace imgProc::imgA4;
	  AT_SDRAM_SECTION_ALIGN(static uint8_t img_test[MT9V03X_CSI_H][MT9V03X_CSI_W], 64);

    for (;;) 
	    {
			uint8_t* img = mt9v03x_csi_image_take();  
			SobelAutoThreshold((uint8_t(*)[MT9V03X_CSI_W])img,img_test,13);
			ips200_displayimage032_zoom1((uint8_t*)img_test,MT9V03X_CSI_W,MT9V03X_CSI_H,0,0,320,240);
       		mt9v03x_csi_image_release();
      }
   }
 rtthread::Thread imgUSBXferThread(imgUSBXferEntry, NULL, 4096*20, 11, 500, "imgUSBXfer");
	 




